package simple17.visit;

import simple17.fruit.Apple;
import simple17.fruit.Banana;
import simple17.fruit.Fruit;
import simple17.fruit.Orange;

/**
 * java方法重载无法识别真实类型
 */
public class Visit {
    public int sell(Apple apple){
        System.out.println("apple's price ￥50");
        return 50;
    }

    public int sell(Orange orange){
        System.out.println("orange's price ￥20");
        return 20;
    }

    public int sell(Banana banana){
        System.out.println("banana's price ￥30");
        return 30;
    }
    public int sell(Fruit fruit){
        System.out.println("other price ￥10");
        return 10;
    }
}
